<template>
  <div v-if="model&&model.modelKey=='gameIconBox'" :key="model.modelKey" class="model_box all-game">
    <div class="game-box flex" v-if="gameList&&gameList.length" :style="`backgroundColor:${model.bgColor||''};${model.bgImage?('backgroundImage:url('+model.bgImage+');'):''}color:${model.txtColor||''}`">
      <div v-for="(item, index) in gameList" :key="index" class="game-item">
        <div class="img">
          <img :src="item.icon">
        </div>
      </div>
      <div class="game-item moregame">
        <div class="img">
          <img src="https://h5.yududs.com/static/img/gengduos.png">
        </div>
        <div class="txt">
          更多游戏
        </div>
      </div>
    </div>
    <!-- <div class="btn_zhezhao" @click="clickItem('set')">
      <i @click="clickItem('set')" class="el-icon-setting"></i>
    </div> -->
    <zhezhao @clickSet="clickItem('set')"></zhezhao>
    
  </div>
</template>

<script>
import zhezhao from '../zhezhao.vue';
export default {
  components:{zhezhao},
  props: {
    model: {
      type: Object,
      default: () => ({}),
    },
    gameList: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    clickItem(type) {
      this.$emit("clickItem", { type: type, modelKey: this.model.modelKey });
    },
  },
};
</script>
<style lang="scss" scoped>
.all-game {
  .game-box {
    background-color: #fff;
    border-radius: 5px;
    overflow: hidden;
    flex-wrap: wrap;
    text-align: center;
    padding: 10px;
    padding-top: 10px;
    border-radius: 8px;

    .game-item {
      margin-bottom: 10px;
      margin-right: 17px;

      &:nth-of-type(5n) {
        margin-right: 0;
      }

      .img {
        width: 48px;
        height: 48px;
        border-radius: 8px;
        overflow: hidden;
        margin: 0 auto;
        img {
          width: 100%;
          height: 100%;
        }
      }

      &.moregame {
        margin-bottom: 0;
        .img {
          width: 32px;
          height: 32px;
        }

        .txt {
          margin-top: 5px;
        }
      }
    }
  }
}
</style>